// 统一管理项目 用户相关的接口
import request from "@/utils/request";


// 项目用户相关的请求地址
enum API {
  GET_ARTCLETYPE_URL = "/articletype/getArticleType/",
  ADD_ARTCLETYPE_URL = "/articletype/addArticleType",
  DELETE_ARTCLETYPE_URL = "/articletype/deleteArticleType/",
  DELETE_ARTCLETYPES_URL = "/articletype/deleteArticleTypes",
  UPDATE_ARTCLETYPE_URL = "/articletype/updateArticleType",
  SERACH_ARTICLETYPE_URL = "/articletype/serachArticleType",
  GET_ARTCLETYPENUMBER_URL = "/articletype/getArticleTypeNumber",
}
export const reqGetArticleType = (pageNo:number,limit:number) => {
    return request.get(API.GET_ARTCLETYPE_URL +pageNo+"/"+limit)
}

export const reqAddArticleType = (data: any) => {
    return request.post(API.ADD_ARTCLETYPE_URL, data)
}

export const reqDeleteArticleType = (id: number) => {
    return request.delete(API.DELETE_ARTCLETYPE_URL+ id)
}

export const reqDeleteArticleTypes = (ids: [number]) => {
    return request.post(API.DELETE_ARTCLETYPES_URL, ids)
}
export const reqUpdateArticleType = (data: any) => {
    return request.put(API.UPDATE_ARTCLETYPE_URL, data)
}
export const reqSerachArticleType = (data: any) => {
    return request.post(API.SERACH_ARTICLETYPE_URL, data, { headers: { "Content-Type": "application/json;charset=UTF-8" } })
}

export const reqGetArticleTypeNumber = () => {
    return request.get(API.GET_ARTCLETYPENUMBER_URL)
}